package com.sise.wangzhan.client;

import feign.Headers;
import feign.RequestLine;
import lombok.Data;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @Classname XmlClient
 * @Description TODO
 * @Date 2020/4/9 9:56
 * @Created by wangzhan
 */
public interface XmlClient {
    @RequestLine("POST /stu/createstu")
    //声明请求类型为xml
    @Headers("Content-Type: application/xml")
    Result createStu(Stu stu);

    //@Data
    @XmlRootElement
    class Stu {
        @XmlElement
        public Integer sid;
        @XmlElement
        public String sname;
        @XmlElement
        public int chinese;
        @XmlElement
        public int math;
        @XmlElement
        public int english;
        /*@XmlElement
        public String message;*/
    }

    //@Data
    @XmlRootElement
    class Result{
        @XmlElement
        public String message;
    }
}
